package org.langqiao.algorithm.recursion;
/*
 * 翻转字符串
 */
public class ReverseStr {
	
	public static void main(String[] args) {
		System.out.println(reverseString("abcdefg"));
	}
	
	public static String reverseString(String x) {
		if(x == null || x.length() < 2)
			return x;
		return reverseString(x.substring(1)) + x.charAt(0);
	}

}
